home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Prog / A / ACL 1.0.sit / ACL / Animation Class Library / Headers / AnimFrame.h / AnimFrame.h
Encoding:
C/C++ Source or Header  |  1994-09-02  |  1.8 KB  |  77 lines  |  [TEXT/MPCC]

  1.  
  2. /********************************************
  3.  **** Animation Class Library V1.0 © 1994 Yves Schmid & Alia Development
  4.  ****
  5.  **** AnimFrame.h
  6.  ****
  7.  **** Created:      16 May 1994
  8.  **** Modified:     01 Septembre 1994
  9.  **** Version:      0
  10.  **** Compatible:   C++, Mac System 7
  11.  ****
  12.  **** Description:  AnimFrame is a class which handles one frame of an
  13.  ****                animation sequence. 
  14.  ****
  15.  ****                AnimFrame is a child class of the CoreHead class.
  16.  ****
  17.  *******************/
  18.  
  19. #ifndef AnimFrame_H
  20. #define AnimFrame_H
  21.  
  22.  
  23. #include "AnimGfx.h"
  24. #include "CoreHead.h"
  25.  
  26. class Anim;
  27.  
  28. class AnimFrame : public CoreHead
  29. {
  30.  
  31.     //***********************************************************
  32.     //.............. P U B L I C   M E T H O D S.................
  33.  
  34.     public:
  35.  
  36.     AnimFrame(Anim *anim, long sequence);
  37.     ~AnimFrame();
  38.     
  39.     inline short getwidth(void) const {return (gfx)?gfx->getwidth():0;}
  40.     inline short getheight(void) const {return (gfx)?gfx->getheight():0;}
  41.  
  42.     inline short getchangecounter(void) const {return changecounter;}
  43.     inline short getoffsetx(void) const {return offsetx;}
  44.     inline short getoffsety(void) const {return offsety;}
  45.  
  46.     inline void setchangecounter(const short c) {changecounter = c;}
  47.     inline void setoffsetx(const short x) {offsetx = x;}
  48.     inline void setoffsety(const short y) {offsety = y;}
  49.     
  50.     inline void usegfx(AnimGfx    *obj) {gfx = obj;}
  51.     inline void removegfx(void) {gfx = NULL;}
  52.     inline AnimGfx *getgfx(void) {return gfx;}
  53.     
  54.     inline void draw(const short x, const short y) 
  55.         {if (gfx) gfx->draw(x+offsetx,y+offsety);}
  56.  
  57.     void relink(Anim *anim, long sequence, long pos); 
  58.  
  59.  
  60.     //***********************************************************
  61.  
  62.     protected:
  63.  
  64.     virtual void receivecmd(long cmd, void *info);
  65.  
  66.     private:
  67.  
  68.     short        changecounter;    
  69.                                                         
  70.     short        offsetx,offsety;
  71.     AnimGfx        *gfx;
  72. };
  73.  
  74.  
  75. #endif
  76.  
  77.